.TH std::ranges::lazy_split_view::base 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::ranges::lazy_split_view::base \- std::ranges::lazy_split_view::base

.SH Synopsis
   constexpr V base() const& requires std::copy_constructible<V>; \fB(1)\fP \fI(since C++20)\fP
   constexpr V base() &&;                                         \fB(2)\fP \fI(since C++20)\fP

   Returns a copy of the underlying view.

   1) Copy constructs the result from the underlying view.
   2) Move constructs the result from the underlying view.

.SH Parameters

   \fI(none)\fP

.SH Return value

   A copy of the underlying view.

.SH Example


// Run this code

 #include <iostream>
 #include <ranges>
 #include <string_view>

 void print(std::string_view rem, auto const& r, std::string_view post = "\\n") {
     for (std::cout << rem; auto const& e : r)
         std::cout << e;
     std::cout << post;
 }

 int main()
 {
     constexpr std::string_view keywords{ "this,..throw,..true,..try,.." };
     constexpr std::string_view pattern{",.."};
     constexpr std::ranges::lazy_split_view lazy_split_view{keywords, pattern};
     print("base() = [", lazy_split_view.base(), "]\\n"
           "substrings: ");
     for (auto const& split: lazy_split_view)
         print("[", split, "] ");
 }

.SH Output:

 base() = [this,..throw,..true,..try,..]
 substrings: [this] [throw] [true] [try] []

.SH See also

   base    returns a copy of the underlying (adapted) view
   (C++20) \fI(public member function of std::ranges::split_view<V,Pattern>)\fP
